<template>
  <div>

    <el-row >
           <el-col :span="24">
            <el-form   class="demo-form-inline">
              <el-form-item >
                <el-input  placeholder="请输入标的编码" v-model="tenderId" clearable style="float:left;width:300px;margin-left:200px"></el-input>
                  <el-button icon="el-icon-search"  type="primary"  style="float:left" @click="doSearchBtn"></el-button>
                  <el-select v-model="auditResult" clearable placeholder="请选择审核结果"  @change="doSelect" style="margin-left:100px">
                    <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                    </el-option>
                </el-select>
               </el-form-item>
                 </el-form>
                 
           </el-col>
    </el-row>

    <el-row>
      <el-col :span="24">
        <el-table
    :data="tableData"
    border
    style="width: auto;">
    <el-table-column
      type="index"
      label="序号"
      align="center"
      width="50"
    ></el-table-column>
    <el-table-column
      label="标的编码"
      align="center"
      >
    <template slot-scope="scope">
        <el-link type="primary" @click="seeTender(scope.row)">{{ scope.row.tenderId }}</el-link>
        </template>
    </el-table-column>
    <el-table-column
      label="审核结果"
      align="center">
      <template slot-scope="scope">
        <label v-if="scope.row.auditResult==1">通过</label>
        <label v-if="scope.row.auditResult==2">未通过</label>
      </template>

    </el-table-column>
    <el-table-column
      prop="auditTime"
      label="审核时间"
      align="center">
    </el-table-column>
  </el-table>
      </el-col>
    </el-row>

    <el-row>
           <el-col :span="24" :offset="6">
            <el-pagination
              
              background
              @size-change="sizeChange"
              @current-change="currentChange"
              :current-page="pageNum"
              :page-sizes="[3, 6, 9]"
              :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total">
            </el-pagination>
            </el-col>
        </el-row>


  </div>

  
</template>

<script>
export default {
        data(){
            return{
                tableData:[],
                pageNum:1,
                pageSize:3,
                total:0,
                auditResult:'',
                tenderId:'',
                options:[
                    {value:'1',label:'通过'},
                    {value:'2',label:'未通过'},
                ]

            }
        },
        created(){
            this.getAuditRecord()
        },
        methods:{
            
            doSelect(e){
                this.auditResult = e
                this.pageNum = 1
                this.getAuditRecord()
            },
            doSearchBtn(){
                this.pageNum = 1
                this.getAuditRecord()
            },
            currentChange(p){
                this.pageNum=p
                this.getAuditRecord()
             },
            sizeChange(p){
                this.pageNum=1
                this.pageSize=p
                this.getAuditRecord()
            },
            getAuditRecord(){
                let param ={}
                param.pageNum = this.pageNum
                param.pageSize = this.pageSize
                let data = {}
                data.auditResult = this.auditResult
                data.tenderId = this.tenderId
                param.data = data
                this.$axios.post('api/tenderAudit/queryTenderAudit',param,{headers:{'jwt':localStorage.getItem('jwt')}})
                .then(res=>{
                    
                    let pageDate = res.data.data
                    this.tableData = pageDate.list
                    this.pageNum = pageDate.pageNum
                    this.pageSize = pageDate.pageSize
                    this.total = pageDate.total
                })
            }
        }
}
</script>

<style scoped>

</style>